<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>forEach方法迭代</title>
</head>
<body>
    <script>
        var myMap = new Map();
        myMap.set(0, "zero");
        myMap.set(1, "one");

        //将会显示俩个logs。一个是"0 = zero" 另一个是"1 = one"
        myMap.forEach(function(value, key) {
            console.log(key + "=" + value);
        }, myMap)
    </script>
</body>
</html>